﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace Lisphi.Lab.ProfWFChap05
{
	public sealed partial class EnrollmentWorkflow: SequentialWorkflowActivity
	{
		public EnrollmentWorkflow()
		{
			InitializeComponent();
		}

        public static DependencyProperty ApplicationNameProperty = DependencyProperty.Register("ApplicationName", typeof(System.String), typeof(Lisphi.Lab.ProfWFChap05.EnrollmentWorkflow));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Parameters")]
        public String ApplicationName
        {
            get
            {
                return ((string)(base.GetValue(Lisphi.Lab.ProfWFChap05.EnrollmentWorkflow.ApplicationNameProperty)));
            }
            set
            {
                base.SetValue(Lisphi.Lab.ProfWFChap05.EnrollmentWorkflow.ApplicationNameProperty, value);
            }
        }

        private void EnrollmentApprovalInvoked(object sender, ExternalDataEventArgs e)
        {
            EnrollmentApprovalEventArgs args = e as EnrollmentApprovalEventArgs;
            Console.WriteLine(string.Format("{0} {1}!", this.ApplicationName, args.Approved ? "approved" : "rejected"));
        }
	}

}
